<html>
<head><meta charset="utf-8"><title>*mut T -&gt; &amp;T · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/*mut.20T.20-.3E.20.26T.html">*mut T -&gt; &amp;T</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="198384908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/%2Amut%20T%20-%3E%20%26T/near/198384908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/*mut.20T.20-.3E.20.26T.html#198384908">(May 21 2020 at 22:23)</a>:</h4>
<p>If I have a <code>*mut T</code>, can I turn it into a reference with <code>&amp;*ptr</code> without enforcing uniqueness, or do I have to cast it to a <code>*const T</code> first? <code>&amp;*(ptr as *const T)</code></p>



<a name="198392518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/%2Amut%20T%20-%3E%20%26T/near/198392518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/*mut.20T.20-.3E.20.26T.html#198392518">(May 21 2020 at 23:49)</a>:</h4>
<p>It's the same either way if you're making <code>&amp;T</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>